package com.iretailer.report.model;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.List;

/**
 * @Auther Bennie
 * @Date 2020/6/9 15:06
 * @Description
 */
@TableName(value = "d_location")
@Data
public class Location {

    public static Location FirstLocation = new Location("-", "smart_retail", -1);

    public Location() {
    }

    public Location(String id, String name, int getWeather) {
        this.id = id;
        this.name = name;
        this.getWeather = getWeather;
    }


    @JSONField(name = "Id")
    @TableId(value = "Id", type = IdType.UUID)
    private String id;

    @JSONField(name = "Name")
    @TableField(value = "Name")
    private String name;

    @JSONField(name = "Level")
    @TableField(value = "Level")
    private Integer level;

    @JSONField(name = "ParentId")
    @TableField(value = "ParentId")
    private String parentId;

    /**
     * 1为获取天气，-1为不获取天气
     */
    @JSONField(name = "GetWeather")
    @TableField(value = "GetWeather")
    private Integer getWeather;

    @JSONField(name = "WeatherCode")
    @TableField(value = "WeatherCode")
    private String weatherCode;

    @JSONField(name = "Unit")
    @TableField(value = "Unit")
    private String unit;

    @JSONField(name = "WeatherLanguage")
    @TableField(value = "WeatherLanguage")
    private String weatherLanguage;

    @JSONField(name = "ApiTypeId")
    @TableField(value = "ApiTypeId")
    private String apiTypeId;

    @JSONField(name = "Ranked")
    @TableField(value = "Ranked")
    private Integer ranked;


    @JSONField(name = "UpdateUser")
    @TableField(value = "UpdateUser")
    private String updateUser;

    @JSONField(name = "UpdateTime")
    @TableField(value = "UpdateTime")
    private LocalDateTime updateTime = LocalDateTime.now();


    @JSONField(name = "children")
    @TableField(exist = false)
    private List<Location> children;

}
